package com.explorati.interview.interview.chapterten;

import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Date;

public class TCPServerA {

	public static void main(String[] args) throws Exception {
		ServerSocket ss = new ServerSocket(8888);
		Socket s = ss.accept();
		OutputStream os = s.getOutputStream();
		PrintWriter pw = new PrintWriter(os);
		pw.print("now time = " + new Date());
		pw.flush();

		pw.close();
		s.close();
		ss.close();
	}
}
